import React from 'react';
import logo from './logo.svg';
import './App.css';
const electron = window.require('electron');
const { dialog } = electron.remote;
const fs=window.require('fs');
const showFile=async ()=>{
  // ipcRenderer.send('showFileChoose');
  const result=await dialog.showOpenDialog({ properties: ['openFile', 'openDirectory'] });
  fs.readFile(result.filePaths[0],(err:Error,data:string|Buffer)=>{
    if(err){
      throw err
    }
    console.log(data.toString());
  })
};
function App() {
  return (
    <div className="App">
      <button onClick={showFile}>Test</button>
    </div>
  );
}

export default App;
